<?php    
    //set it to writable location, a place for temp generated PNG files
    $PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR;
     //html PNG location prefix
    $PNG_WEB_DIR = 'temp/';
    include "qrlib.php";    
     //ofcourse we need rights to create temp dir
    if (!file_exists($PNG_TEMP_DIR))
        mkdir($PNG_TEMP_DIR);
    $filename = $PNG_TEMP_DIR.'test.png';
    $errorCorrectionLevel = 'Q'; //$_REQUEST['level'];    
   $matrixPointSize = 4;
	$_REQUEST['size']=6;
    $matrixPointSize = min(max((int)$_REQUEST['size'], 1), 10);
    $_REQUEST['data']="ddsfds dfdsfds alvaro 12345";
        // user datafdsf
        $filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png';
        QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2);    
    //display generated file
    echo '<img src="'.$PNG_WEB_DIR.basename($filename).'" />';  